package com.github.shiqiyue.learn.curator;

import org.apache.curator.framework.CuratorFramework;
import org.apache.zookeeper.CreateMode;

/***
 * 新建节点-测试
 * @author wenyao.wu
 * @date 2019/1/21
 */
public class CreateTest {

    public static void main(String[] args) throws Exception {
        CuratorFramework curatorFramework = ClientUtil.getClient(null);
        Integer num = 100;
        for (int i = 0; i < num; i++) {
            curatorFramework.create().creatingParentsIfNeeded().withMode(CreateMode.EPHEMERAL_SEQUENTIAL).forPath("/t1/v");

        }
        System.in.read();
        curatorFramework.close();
    }

}
